/*
 * Copyright (c) 2017. 深圳掌控网络有限公司. All rights reserved.
 */

package com.yiqi.lottery.feature.login.contract;

import com.suozhang.framework.entity.bo.UserInfoBo;
import com.suozhang.framework.framework.BasePresenter;
import com.suozhang.framework.framework.BaseView;
import com.yiqi.lottery.entity.bo.RegisterBo;
import io.reactivex.Observable;

/**
 *      LIJUWEN
 * @email yiyayiyayaoljw@gmail.com
 * @date 2017/4/11 9:06
 */
public interface LoginContract {

    interface Model {
        Observable<UserInfoBo> userLogin(RegisterBo registerBo);
        Observable<String> userLogout();
    }

    interface View extends BaseView {
        void showLoginSuccess();

        void showLogOutSuccess();

        void showLoginError(String error);
        /**
         * 设置用户帐号信息，如果是记住密码的状态，进入界面自动获取缓存中的用户信息并设置
         *
         * @param username
         * @param password
         * @param isRemember
         */
        void setUserAccount(String username, String password, boolean isRemember);

    }


    interface Presenter extends BasePresenter {
        void doUserLogin(String mobile,String password,boolean isRember);
        /**
         * 初始化用户帐号信息，从缓存中获取保存的信息，并设置
         */
        void initUserAccount();

        /**
         * 设置记住密码
         *
         * @param isRemember
         */
        void setRememberPassword(boolean isRemember);

        void  userLogout();

    }
}
